package com.google.denta.service;

import java.util.List;

import com.google.denta.dao.RoleDao;
import com.google.denta.entity.Role;

/**
 * Role service implementation.
 * @author Kiril_Akshonau
 */
public class RoleServiceImpl implements RoleService {

    /** Dao. */
    private RoleDao roleDao;

    /** Setter for roleDao.
     * @param dao - Dao
     */
    public void setRoleDao(final RoleDao dao) {
        this.roleDao = dao;
    }

    /** {@inheritDoc} */
    public List<Role> getRoles() {
        return roleDao.findAll();
    }

    /** {@inheritDoc} */
    public Role getRole(final Long id) {
        return roleDao.read(id);
    }
}
